package cn.yunhe.action;

import cn.yunhe.entity.User;
import cn.yunhe.service.LoginService;
import cn.yunhe.util.BaseUtil;
import lombok.Data;

@Data
public class LoginAction extends BaseUtil {
    private String username;
    private String password;

    public String execute(){
        LoginService loginService=new LoginService();
        User user=null;
        user=loginService.login(username,password);
        if (user!=null){
            getSession().setAttribute("user",user);
            return "success";
        }else {
            return "fail";
        }
    }
}
